<template>
	<view>
		<view class="page">
			<u--textarea height="36vh" class="area" v-model="contents" placeholder="请输入内容" count maxlength="200"></u--textarea>
			<u-button class="btn" @click="submit" type="primary" text="提交" />
		</view>
	</view>
</template>

<script>
	import {feedback} from '@/api/common.js';
	export default {
		data() {
			return {
				contents: '',
			}
		},
		onReady() {},
		methods: {
			submit() {
				console.log('确认提交:')
				feedback({
					"jianyi":this.contents
				}).then(res => {
					uni.showToast({
						title:"意见提交成功",
						icon:'none'
					});
					setTimeout(()=>{
						uni.navigateBack({
							delta: 1
						});
					},500)
				}).catch(err =>{
					console.log(err);
					uni.showToast({
						title:err,
						icon:'none'
					});
				})
			}
		}
	}
</script>

<style lang="scss">
	.page {
		width: 84vw;
		margin-left: 8vw;
		margin-top: 10vh;
	}

	.u-button {
		margin-top: 4vh;
	}
	
</style>